package com.twq.oo.traits

/**
 * Created by tangweiqun on 2017/12/1.
 */
trait MyOrdered[T] {
  def compare(that: T): Int

  def <(that: T): Boolean = (this compare that) < 0

  def >(that: T): Boolean = (this compare that) > 0

  def <=(that: T): Boolean = (this compare that) <= 0

  def >=(that: T): Boolean = (this compare that) >= 0
}
